package com.kede.ienum;

import com.baomidou.mybatisplus.annotation.EnumValue;
import lombok.AllArgsConstructor;
import lombok.Getter;

/***
 ** @Author:Pr.li
 ** @Description:商品状态:0=删除,1=仓库,2=上架
 ** @Date: create in 2023/5/15 22:58
 ***/
@Getter
@AllArgsConstructor
public enum GoodStatusEnum {
    DEL(0,"删除",1),
    DOWN(1,"仓库",2),
    UP(2,"上架",3);


    @EnumValue
    private Integer code;
    private String value;
    private Integer enumIndex;
    public static GoodStatusEnum parse(Integer code) {
        for (GoodStatusEnum value : values()) {
            if (value.code.equals(code)) {
                return value;
            }
        }
        return null;
    }
}
